import matplotlib.pyplot as plt

# 示例数据，您需要根据实际数据替换这里的值
iterations =        [8000  , 10000 , 12000 , 14000 , 16000 , 18000 , 20000]  # 迭代次数
src_imd_mix_loss =  [0.4435, 0.4071, 0.3341, 0.3863, 0.2867, 0.2795,0.2790]  # src_imd_mix.decode.loss_seg 的值
mix_loss =          [0.4237, 0.4236, 0.2488, 0.2799, 0.2611, 0.2663,0.2074]  # mix.decode.loss_seg 的值
src_loss =          [0.4554, 0.4673, 0.4690, 0.3479, 0.3606, 0.3406,0.2968]  # src.decode.loss_seg 的值

# 创建图表
plt.figure(figsize=(10, 5))

# 绘制每种类型的损失
plt.plot(iterations, src_imd_mix_loss, label='src_imd_mix.decode.loss_seg', marker='o')
plt.plot(iterations, mix_loss, label='mix.decode.loss_seg', marker='s')
plt.plot(iterations, src_loss, label='src.decode.loss_seg', marker='^')

# 添加标题和标签
plt.title('Loss Seg Over Iterations')
plt.xlabel('Iterations')
plt.ylabel('Loss Value')
plt.legend()  # 显示图例

# 展示图表
plt.show()